#include <stdio.h>
#include "../sean.cpp"

int main()
{
	int xx, xy, yx, yy, px, py;
	double ddist, r, s;

	scanf("%d %d %d %d %d %d", &xx, &xy, &yx, &yy, &px, &py);
	if(xx == 0 && xy == 0 && yx == 0 && yy == 0 && px == 0 && py == 0)
		return 0;

	ddist = distToLineSeg(xx, xy, yx, yy, px, py, &r, &s);

	printf("%f\n", ddist);

	return main();
}
